<html>
    <head>
        <title>emitter测试</title>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,shrink-to-fit=no,viewport-fit=cover">
        <style>
            .btn{
                width: 50%;
                height:60px;
                background: #fcc;
                color:#333;
                font-size: 38px;
                line-height: 60px;
                text-align: center;
            }
        </style>
    </head>
    <body>
        <div class="btn" id="btnwrap" >测试</div>
        <!-- <script src="../index.js"></script> -->
        <script src="eventEmitter.js"></script>
        <script>
            var emitter = new EventEmiter()
            emitter.on("test",function(a,b){
                console.log(a+'——————'+b)
            })
            emitter.on("atest",function(a,b){
                console.log(a+'——————'+b)
            })
            let btnWrap = document.getElementById("btnwrap")
            function clickHandler(e){
                console.log('aa')
                emitter.emit("test",'1','a1');
            }
            btnWrap.onclick= clickHandler
        </script>
    </body>
</html>